package com.yidu.DailyFinalTreatment.service.impl;

import com.yidu.BusinessParameters.entity.Trade;
import com.yidu.DailyFinalTreatment.entity.AssetValuationData;
import com.yidu.DailyFinalTreatment.entity.AssetValuationMjoinS;
import com.yidu.DailyFinalTreatment.mapper.AsseMapper;
import com.yidu.DailyFinalTreatment.service.AsseService;
import com.yidu.StockControl.entity.CashInventory;
import com.yidu.StockControl.entity.SecurityInventory;
import com.yidu.TAManagement.entity.TABusiness;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AsseServiceImpl implements AsseService {
    @Autowired
    private AsseMapper asseMapper;


    @Override
    public List<AssetValuationData> selectTable() {
            //插入估值类型和估值状态
            AssetValuationData assetValuation = new AssetValuationData(1,"证券估值增值","未估值");
            AssetValuationData assetValuation1 = new AssetValuationData(2,"清算款","未清算");
            List<AssetValuationData> assetValuationList = new ArrayList();
            assetValuationList.add(assetValuation);
            assetValuationList.add(assetValuation1);
            return assetValuationList;
    }

    @Override
    public List<AssetValuationMjoinS> selectStockarket(String securityInventorsTime, String fundId) {
        System.out.println("这是impl类参数值是"+securityInventorsTime+fundId);
        Map map = new HashMap();
        map.put("dateTime",securityInventorsTime);
        map.put("fundId",fundId);
        List<AssetValuationMjoinS>  assetValuationMjoinS = asseMapper.selectStockarket(map);
        return assetValuationMjoinS;
    }

    @Override
    public int delectSecurityAccrualStock(SecurityInventory securityInventory) {
        int i = asseMapper.delectSecurityAccrualStock(securityInventory);
        return i;
    }

    @Override
    public List<Trade> selectTransactionData(String tradeDate) {
        Map map = new HashMap();
        map.put("tradeDate",tradeDate);
        List<Trade> dealData = asseMapper.selectTransactionData(map);
        return dealData;
    }

    @Override
    public List<TABusiness> selectTa(String businessTime) {
        Map map = new HashMap();
        map.put("businessTime",businessTime);
        List<TABusiness> tas = asseMapper.selectTa(map);
        return tas;
    }

    @Override
    public int delectCashAccrualStock(CashInventory cashInventory) {
        int i = asseMapper.delectCashAccrualStock(cashInventory);
        return i;
    }
}
